<!DOCTYPE html>
<html lang="en">
    <head>
        <title></title>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">
        <script src="./vue2.js"></script>
    </head>
    <body>
        <div id="app">
            <input type="text" name="" id="" v-model="user.name">
        </div>
        <script>
            var vm = new Vue({
                el: '#app',
                data: {
                    user:{
                        name:"张三"
                    }
                },
                watch:{
                    user:{
                        handler(newVal){
                            console.log(111111);
                            console.log(newVal.name);
                            
                        },
                        deep:true
                    }
                }
            })
        </script>
    </body>
</html>